<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<%
	String idStr=request.getParameter("id");
	//out.println("del id="+idStr);
	Integer id=Integer.parseInt(idStr);
	
	Class.forName("com.mysql.jdbc.Driver");
	Connection conn = null;
	PreparedStatement pst = null;
	String url = "jdbc:mysql://localhost:3306/2012jb?useUnicode=true&characterEncoding=UTF-8";
	String userName = "root";
	String dbpwd = "123456";
	conn = DriverManager.getConnection(url, userName, dbpwd);
	String sql = "DELETE FROM USER WHERE ID=?";
	pst = conn.prepareStatement(sql);
	pst.setInt(1, id);
	if (pst.executeUpdate() == 1) {
		System.out.println("del user OK");
		response.sendRedirect("list.jsp");
	} else {
		System.out.println("del user error");

	}
	pst.close();
	conn.close();

%>